<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<!--{$CHARSET}-->" />
	<title><!--{$title}--> -<!--{$config_core.seo_title}--></title>
	<meta name="keywords" content="<!--{$config_core.head_keywords}-->" />
	<meta name="description" content="<!--{$config_core.head_description}-->" />
	<meta http-equiv="x-ua-compatible" content="ie=7" />
	<meta name="generator" content="CityBao System" />
	<meta name="author" content="www.citybao.net" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="shortcut icon" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="bookmark" />
	<link href="<!--{$CSS_DIR}-->citybao.css" rel="stylesheet" type="text/css" />
	<link href="<!--{$CSS_DIR}-->member.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" language="javascript">
		var CB_CssPath = '<!--{$CSS_DIR}-->';
		var CB_ImgPath = '<!--{$IMG_DIR}-->';
		var CB_JsPath  = '<!--{$JS_DIR}-->';
		<!--{if $SAFE_DOMAIN != ''}-->
		document.domain = '<!--{$SAFE_DOMAIN}-->';
		<!--{/if}-->
	</script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->common.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->member-menu.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->Dialog.js"></script>
</head>
<body>
<!--{include file='header.tpl'}-->
<!--{assign var='guide_suffix' value='会员基本资料'}-->
<!--{include file='guide.tpl'}-->
<div id="container" class="clearfix">
	<!--{include file='member/member-menu.tpl'}-->
	<div class="member-main" id="member-main">
		<div class="fillet filletColor7">
			<b class="fillet1"></b><b class="fillet2"></b><b class="fillet3"></b><b class="fillet4"></b>
			<div class="filletContent">
				<p class="reg_title pr">基本信息<span class="more"><span class="edit_ico"></span><a class="aBlue" href="<!--{$INSTALL_PATH}-->member/profile.php?action=edit">全部修改</a></span></p>
				<dl class="formList">
					<dd>
						<div class="colum_left">
							会员名：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$user->username}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							真实姓名：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->realname}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							性     别：
						</div>
						<div class="colum_right paddingTop5">
							<!--{if $profile->gender == 0}-->男<!--{else}-->女<!--{/if}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							出生日期：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->birthyear}-->年<!--{$profile->birthmonth}-->月<!--{$profile->birthday                                   了了  }-->日 (星座：<!--{$profile->constellation}-->  属相：<!--{$profile->zodiac}-->)
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							所在地：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->resideprovince}--> <!--{$profile->residecity}--> <!--{$profile->residedist}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							教育水平：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->education}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							婚姻状况：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->marital}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							血型：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->bloodtype}--> 型
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							职业：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->occupation}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							单位/公司名称：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->company}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							月收入水平：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->revenue}-->
						</div>
					</dd>
				</dl>
				<p class="reg_title">联络信息</p>
				<dl class="formList">
					<dd>
						<div class="colum_left">
							通讯地址：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->address}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							邮政编码：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->zipcode}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							联系电话：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->telephone}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							E-mail地址：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$user->email}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							QQ：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->qq}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							MSN：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->msn}-->
						</div>
					</dd>
				</dl>
				<p class="reg_title">安全信息</p>
				<dl class="formList">
					<dd>
						<div class="colum_left">
							证件类型：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->idcardtype}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							证件号码：
						</div>
						<div class="colum_right paddingTop5">
							****************
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							密码提示问题：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->question}-->
						</div>
					</dd>
					<dd>
						<div class="colum_left">
							密码提示答案：
						</div>
						<div class="colum_right paddingTop5">
							<!--{$profile->answer}-->
						</div>
					</dd>
				</dl>
			</div>
			<b class="fillet5"></b><b class="fillet6"></b><b class="fillet7"></b><b class="fillet8"></b>
		</div>
	</div>
</div>
 
<script type="text/javascript">
	$(function() {
		//输入框样式
		$(':text,:password')
			.each(function(){
				if($(this).attr('id') == 'password'){
					$(this).bind('keyup',chkKeyboard);
					$(this).bind('keydown',chkKeyboard);
				}else if($(this).attr('id') == 'captcha'){
					$(this).addClass('fGray');
					$(this).attr('value','点击这里显示验证码');
				}
			})
			.focus(function(){
				node = $(this).parents('span.input')
				node.removeClass('inputRed');
				node.addClass('inputGreen');
				showError($(this),'clear');
				if($(this).attr('id') == 'password'){
					$('#passW').show();
				}else if($(this).attr('id') == 'captcha'){
					if($(this).attr('value') == '点击这里显示验证码'){
						$(this).removeClass('fGray');
						$(this).attr('value','');
					}
					if($("#captcha_img").is(":hidden")){
						$("#captcha_img").show();
						get_captcha();
					}
				}
			}).blur(function(){
				node = $(this).parents('span.input')
				node.removeClass('inputGreen');
				validate($(this));
			});
	});
	
	//表单提交验证
	$("#userReg").submit(function(){
		var flag=true;
		$(".tip").each(function(){
			if($(this).html()!='<span class="inputacc"><span class="yes"></span></span>'){
				Dialog("提示","text:请完善表单后再提交！","400","150",true,"",true);
				flag = false;
				return false;
			}
		});
		if(!$("#after").is(":checked")){
			flag = false;
			Dialog("提示","text:同意本站的服务条款后才能注册！<br />请在表单的“我已阅读并接受服务条款”前打勾。","400","150",true,"",true);
		}
		return flag;
	});
	
	/**
	 * 验证表单
	 */
	function validate(e){
		var msg = 'custom';
		$.ajaxSetup({
			url:'<!--{$INSTALL_PATH}-->ajax.php',
			type: "POST"
		});
		
		if(e.attr('name') == 'username'){
			msg = checkUsername(e.val());
			if(msg == 'hide')
				checkUsernameExist(e);
		}
		if(e.attr('name') == 'password'){
			msg = checkPassword(e.val());
		}
		if(e.attr('name') == 'password2'){
			msg = checkPassword2(e.val());
		}
		if(e.attr('name') == 'email'){
			msg = checkEmail(e.val());
			if(msg == 'hide')
				checkEmailExist(e);
		}
		if(e.attr('name') == 'captcha'){
			msg = checkCaptcha(e.val());
			if(msg == 'hide')
				checkCaptchaAjax(e);
		}

		showError(e,msg);
	}
	
	/**
	 * 检验用户名的合法性
	 */
	function checkUsername(username){
		var msg = 'hide';
		var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){3,15}$/;
		if(username == '')
			return '请输入用户名！';
		if (!patrn.exec(username))
			return '用户名格式不正确！';
		return msg;
	}
	
	/**
	 * 检验用户名的可用性
	 */
	function checkUsernameExist(e){
		var username = e.val();
		$.ajax({data:'action=user-exist&username='+username,success:function(responseText){
			if(responseText.search("no")>=0){
				msg = 'hide';
			}else if(responseText.search("yes")>=0){
				msg = '用户名已被占用';
			}else{
				msg = '异步通信错误';
			}
			showError(e,msg);
		}});
	}
	
	/**
	 * 检验密码的合法性
	 */
	 function checkPassword(str){
	 	var len=str.length;
	 	if(str == '')
			return '密码不能为空！';
		if (len>16||len<6)
			return '密码长度不正确！';
		return 'hide';
	 }
	 	
	/**
	 * 检验两次输入密码是否相同
	 */
	 function checkPassword2(str){
	 	var password = $("#password").val();
		if(str == '')
			return '密码不能为空！';
	 	if(str !== password)
			return '两次输入密码不一致！';;
		return 'hide';
	 }
		
	/**
	 * 检验邮箱地址的可用性
	 */
	function checkEmailExist(e){
		var email = e.val();
		$.ajax({data:'action=email-exist&email='+email,success:function(responseText){
			if(responseText.search("no")>=0){
				msg = 'hide';
			}else if(responseText.search("yes")>=0){
				msg = '邮箱地址已被注册，请更换！';
			}else{
				msg = '异步通信错误';
			}
			showError(e,msg);
		}});
	}
	 
	 /**
	  * 检验验证码是否为空
	  */
	 function checkCaptcha(str){
	 	if(str == '')
			return '请输入验证码！';
		return 'hide';
	 }
	 /**
	  * 检验验证码是否正确
	  */
	 function checkCaptchaAjax(e){
	 	var code = e.val();
		$.ajax({data:'action=check-captcha&code='+code,success:function(responseText){
			if(responseText.search("yes")>=0){
				msg = 'hide';
			}else if(responseText.search("no")>=0){
				msg = '验证码输入错误！';
			}else{
				msg = '异步通信错误';
			}
			showError(e,msg);
		}});
	 }
	
	function get_captcha() {
		var qq = Math.round((Math.random()) * 100000000);
		$.ajax({
			beforeSend:function(XHR){
				$("#check_img").attr('src', CB_ImgPath+"ajaxloading.gif");
			},
			error:function(){
				$("#captcha_img").html("<span class='fRed'>加载数据出错...</p>");
			},
			success:function(html){
				$("#check_img").attr('src', '<!--{$INSTALL_PATH}-->ajax.php?action=captcha&r=' + qq);
			}
		});
	}
</script>
<!--{include file='footer.tpl'}-->
</body>
</html>